import { getAction } from '@/api/controller';

export interface DeviceInfo {
  createTime: number
  updateTime: number
  creator: string
  updater: string
  deleted: boolean
  id: number
  deviceTypeId: number
  deviceName: string
  deviceCode: string
  extIotDeviceId: string
  ipAddress: string
  subnetMask: string
  gatewayAddress: string
  dns: string
  devicePort: number | null
  sectionId: number
  sectionName: string | null
  wardId: number
  wardName: string | null
  clinicId: number
  operationId: number | null
  lastOnlineTime: number | null
  status: number
  roomId: number | null
  bedId: null
  deviceTypeName: null
  sickRoomId: null
  sickRoomName: null
  operationRoomName: null
  bedName: null
  clinicName: null
  password: null
  sip: null
  bindDeviceCode: null
  isCall: null
  bindDeviceIsCall: null
}

export const DeviceInfoApi = {
  /**
   * 根据设备编码获取设备信息
   * @param deviceCode 设备编码
   */
  getDeviceInfo: (deviceCode: string) => getAction<DeviceInfo>('healthcare/device-info/getByDeviceCode', { deviceCode }, {
    silentLogin: true
  })
};
